﻿using System;

namespace Library.Gsm.AtCommands {
  public class ListSmsCommand : BaseAtCommand {
    protected override string GetCommandText(params object[] t) {
      return String.Format("AT+CMGL=\"{0}\"", ConvertSmsStatus((SmsStatus)t[0]));
    }

    protected static string ConvertSmsStatus(SmsStatus status) {
      switch (status) {
        case SmsStatus.Read:
          return "REC READ";
        case SmsStatus.UnRead:
          return "REC UNREAD";
        case SmsStatus.UnSent:
          return "STO UNSENT";
        case SmsStatus.Sent:
          return "STO SENT";
        case SmsStatus.All:
          return "ALL";
      }
      return String.Empty;
    }
  }
}
